import pkgJson from '../../package.json';

export const getTenantTypeByPkg = () => {
  const dependencies = pkgJson.dependencies;

  const key = Object.keys(dependencies).find(key => key.indexOf('hussar-tenant-') !== -1);

  return key ? key.replace(/^hussar-tenant-/, '') : '';
};

window.tenantType = getTenantTypeByPkg();
